local skel = fk.CreateSkill {
  name = "emo__zihui",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable{
  ["emo__zihui"] = "自毁",
  [":emo__zihui"] = "锁定技，当你进入濒死状态时，你扣减一点体力上限，若为你回合内/回合外，你回复所有体力/结束当前回合。",
}

skel:addEffect(fk.EnterDying, {
  anim_type = "defensive",
  on_use = function (self, event, target, player, data)
    local room = player.room
    room:changeMaxHp(player, -1)
    if player.dead then return end
    if player == room:getCurrent() then
      room:recover { num = player.maxHp - player.hp, skillName = skel.name, who = player, recoverBy = player }
    else
      room:endTurn()
    end
  end,
})

return skel
